abstract class Animal{
     abstract String getAnimalName();
     abstract void cry();
}
class Dog extends Animal {   
    public String getAnimalName() {  
        return "狗";  
    }   
    public void cry() {  
        System.out.println("汪");  
    }  
} 

class Cat extends Animal {    
    public String getAnimalName() {  
        return "猫";  
    }    
    public void cry() {  
        System.out.println("喵");  
    }  
} 

class Simulator {
    public void sound(Animal animal) {
        animal.cry();
        System.out.println("这是：" + animal.getAnimalName());
    }
}

public class Application {  
    public static void main(String[] args) {  
        Animal animal; 
        

        animal = new Dog(); 

        Simulator simulator=new Simulator();
        simulator.sound(animal); 
            
        animal = new Cat(); 
        simulator.sound(animal);
          
    }  
}
